<?php
    $id = $_GET['id'];
    //$id = '601514'; // for test
    $bstrURL = 'https://wxapp.douyucdn.cn/api/nc/stream/roomPlayer';
    $data = "room_id=$id&big_ct=cpn-androidmpro&did=10000000000000000000000000001501&mt=2&rate=";

    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,$bstrURL);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $data = curl_exec($ch);
    curl_close($ch);
    $json = json_decode($data);
    $szURL = $json->data->live_url;
    header('location:'.$szURL);

?>